package com.gears_software.sxdc.dccx.ui.view;

import android.content.Context;
import android.content.Intent;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.gears_software.sxdc.dccx.R;
import com.gears_software.sxdc.dccx.application.DCCXApplication;
import com.gears_software.sxdc.dccx.data.model.CPOrderModel;
import com.gears_software.sxdc.dccx.ui.activity.ReleaseScheduleActivity_;

import org.androidannotations.annotations.App;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

import java.text.SimpleDateFormat;

/**
 * Created by chezhenzhen on 2017/6/27.
 */

@EViewGroup(R.layout.item_view_chezhu_xingcheng)
public class CheZhuXingCheListItemView extends LinearLayout {
    Context context;

    @ViewById
    TextView txt_triptime_icon;
    @ViewById
    TextView txt_xiugai_icon;
    @ViewById
    TextView txt_cheman_icon;
    @ViewById
    TextView txt_jiantou_icon;
    @ViewById
    TextView txt_vehicleno;
    @ViewById
    TextView txt_car;
    @ViewById
    TextView txt_vehiclecolor;
    @ViewById
    TextView txt_date;
    @ViewById
    TextView txt_start;
    @ViewById
    TextView txt_end;
    @ViewById
    TextView txt_set;
    @App
    DCCXApplication app;

    public CheZhuXingCheListItemView(Context context) {
        super(context);
        this.context = context;
    }
    public void bind(CPOrderModel model) {
        txt_triptime_icon.setTypeface(app.iconfont);
        txt_xiugai_icon.setTypeface(app.iconfont);
        txt_cheman_icon.setTypeface(app.iconfont);
        txt_jiantou_icon.setTypeface(app.iconfont);
        txt_vehicleno.setText(model.getVehicleno());
        txt_vehiclecolor.setText(model.getVehiclecolor());
        txt_car.setText(model.getCarmodel());
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm");

    }
    @Click
    void ly_cheman() {

    }

    @Click
    void ly_xiugai() {
        Intent intent = new Intent(context, ReleaseScheduleActivity_.class);
        context.startActivity(intent);
    }
}
